package com.itheima.web.controller;

import com.itheima.domain.db.Freeze;
import com.itheima.web.manager.FreezeManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FreezeController {
    @Autowired
    FreezeManager freezeManager;
    //冻结
    @PostMapping("/manage/users/freeze")
    public ResponseEntity freezeUser(@RequestBody Freeze freeze){
        return freezeManager.freezeUser(freeze);
    }
    //解冻
    @PostMapping("/manage/users/unfreeze")
    public ResponseEntity unfreezeUser(@RequestBody Freeze freeze){
        return freezeManager.unfreezeUser(freeze);
    }
}
